﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<CustomerSummary>>" %>
<%@ Import namespace="MvcApplication.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Customer Summary
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Customer Summary</h2>
    <form action="<%=Url.Action("Save") %>" method="post">
    <table>
    <tr>
        <th>Name</th>
        <th>Active</th>
        <th>ServiceLevel</th>
        <th>OrderCount</th>
        <th>Active</th>
    </tr>
    <% for (int i = 0; i < Model.Count;i++ )
       {%>
    <tr>
        <td><%=Html.Label(Model[i].Name)%></td>
        <td><%=Html.Label(Model[i].ServiceLevel)%></td>
        <td><%=Html.Label(Model[i].OrderCount)%></td>
        <td><%=Html.Label(Model[i].MostRecentOrderDate)%></td>
        <td><%=Html.CheckBoxFor(customerSummary => customerSummary[i].Active)%></td>
    </tr>
    <% } %>
    </table>
    <div><button type="submit">Change Status</button></div>
    </form>
</asp:Content>
